package com.avril.entity;

import com.avril.util.ValidationManager;

public class OrderDetail {
	int detailId;
	Goods goods;
	float disPrice;
	int amount;
	float totalPrice;
	int orderId;
	String inOrOut;

	public int getDetailId() {
		return detailId;
	}

	public void setDetailId(int detailId) {
		this.detailId = detailId;
	}

	public Goods getGoods() {
		return goods;
	}

	public void setGoods(Goods goods) {
		this.goods = goods;
	}

	public float getDisPrice() {
		return disPrice;
	}

	public void setDisPrice(float disPrice) {
		this.disPrice = disPrice;
	}

	public int getAmount() {
		return amount;
	}

	public void setAmount(int amount) {
		this.amount = amount;
	}

	public float getTotalPrice() {
		return totalPrice;
	}

	public void setTotalPrice(float totalPrice) {
		this.totalPrice = totalPrice;
	}

	public int getOrderId() {
		return orderId;
	}

	public void setOrderId(int orderId) {
		this.orderId = orderId;
	}

	public String getInOrOut() {
		return inOrOut;
	}

	public void setInOrOut(String inOrOut) {
		this.inOrOut = inOrOut;
	}

	public Object getDetailValue(int row, int col) {
		switch (col) {
		case 0:
			return ++row + "";
		case 1:
			return ValidationManager.changeNull(getGoods().getGoodsName());
		case 2:
			return ValidationManager.changeNull(getGoods().getGoodsCode());
		case 3:
			return ValidationManager.changeNull(getGoods().getGoodsType()
					.getTypeName());
		case 4:
			return ValidationManager.changeNull(getGoods().getOutPrice());
		case 5:
			return ValidationManager.changeNull(getDisPrice());
		case 6:
			return ValidationManager.changeNull(getAmount());
		case 7:
			return ValidationManager.changeNull(getTotalPrice());
		case 8:
			return ValidationManager.changeNull(getGoods().getLocation());
		}
		return null;
	}

	public Object getDetailValueIfIn(int row, int col) {
		switch (col) {
		case 0:
			return ++row + "";
		case 1:
			return ValidationManager.changeNull(getGoods().getGoodsName());
		case 2:
			return ValidationManager.changeNull(getGoods().getGoodsCode());
		case 3:
			return ValidationManager.changeNull(getGoods().getGoodsType()
					.getTypeName());
		case 4:
			return ValidationManager.changeNull(getGoods().getInPrice());
		case 5:
			return ValidationManager.changeNull(getGoods().getOutPrice());
		case 6:
			return ValidationManager.changeNull(getGoods().getAmount());
		case 7:
			return ValidationManager.changeNull(getGoods().getLocation());
		}
		return null;
	}
}
